<!DOCTYPE html>
<html lang="ch">
<head>
    <meta charset="utf-8">
    <title>Title</title>
</head>
<body>
<input type="button" value="点我" onclick="on()"><br>
<input type="button" value="再点我" id="btn">

<script>
    function on(){
        alert("我被点了～～");
    }

    document.getElementById("btn").onclick = function(){
        alert("我叕被点了～～～");
    }
</script>
</body>
</html>